#include <Tcp.h>

EnHandleResult TcpServerListener::OnReceive(ITcpServer* pSender, CONNID dwConnID, 
	                                        const BYTE* pData, int iLength) 
{ 
	return HR_OK;
}
EnHandleResult  TcpServerListener::OnClose(ITcpServer* pSender, CONNID dwConnID,
											EnSocketOperation enOperation, int iErrorCode)
{ 
	return HR_OK;
}
EnHandleResult TcpServerListener::OnAccept(ITcpServer* pSender, CONNID dwConnID, UINT_PTR soClient)
{
	m_Server->SetConnectionExtra(dwConnID, TTcpContext::Construct(dwConnID));

	return HR_OK;
}
bool TcpServerListener::Strart(int port)
{
	return m_Server->Start("0.0.0.0", port);
}
TcpServerListener::TcpServerListener()
{
}
TcpServerListener::~TcpServerListener()
{
	m_Server->Stop();
}